<?php namespace Admin\Controller;
/*
 * Ajax
 * */
 use \Hdphp\Controller\Controller;
	class AjaxController extends Controller
	{
		public function index()
		{
			if(!IS_AJAX) return FALSE;
			$cids = $_POST["cids"];
			//echo $cids;
			//规格
			$data = Db::table("category")
				  ->join("typeattribute","category.type_tid","=","typeattribute.type_tid")
				  ->where("cid",$cids)
				  ->get();
			foreach($data as $k=>$v){
				$data[$k]["attr"] = explode("|",$v['avalue']);
			}
			echo json_encode($data);
		}
		
	}

